package com.chb.service.impl;

import com.chb.service.FileService;
import com.chb.utils.OssUtils;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.io.InputStream;

/**
 * @author ：njh
 * @date ：Created in 2023/10/8 9:55
 * @description：文件操作
 * @modified By：
 * @version:
 */
@Service
public class FileServiceImpl implements FileService {

    public OssUtils ossUtils;

    @Override
    public String upload(MultipartFile file) {
        String pictureUrl = ossUtils.ossUpload(file);
        return pictureUrl;
    }


    @Override
    public void removeFile(String pictureUrl) {
        ossUtils.ossRemove(pictureUrl);
    }
}